package operatebag;
import mysqloperate.*;
import javax.swing.*;

public class commonsgow extends JFrame {

    JFrame jf;
    private JTable table;
    private JScrollPane jp;
    commonsgow(String data,int u) throws Exception {
        setTitle("学生数据");
        setLayout(null);
        setBounds(300,100,800,700);
        setResizable(false);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setVisible(true);
        jf=this;
        Object str[]={"学号","姓名","性别","出生日期","数学成绩","Java成绩","体育成绩"};

        searchstu search=new searchstu();

        Object[][] info=search.search();
        Object[][] outdata=new Object[1000][1000];
        int j=0;
        for (int i=0;i<info.length;i++){
            if(data.equals(info[i][u])){
                outdata[j]=info[i];
                j++;
            }
        }


        table=new JTable(outdata,str);
        table.setEnabled(false);

        jp=new JScrollPane(table);
        jp.setBounds(10,10,700,700);
        add(jp);

    }
}
